*use data "ISQReplicationData.dta"
*Analysis run using Stata 16

******************************************
*Table 1 (Main Manuscript): Percent of Recommendations Resulting in Inaction and Compliance Across Precision
******************************************
*All Institutions - Inaction (Low, Medium, High Precision)
**Percentage of recommendations resulting in inaction from all institutions (CEDAW, UPR, ECtHR)
tab inactionbinminuspartial Precision if inactionbinminuspartial == 1, row

*All Institutions - Compliance (Low, Medium, High Precision)
**Percentage of recommendations resulting in compliance from all institutions (CEDAW, UPR, ECtHR)
tab compliancebin Precision if compliancebin == 1, row

*CEDAW - Inaction (Low, Medium, High Precision)
**Percentage of recommendations resulting in inaction from CEDAW
tab inactionbinminuspartial Precision if inactionbinminuspartial == 1 & cedaw == 1, row

*CEDAW - Compliance (Low, Medium, High Precision)
**Percentage of recommendations resulting in compliance from CEDAW
tab compliancebin Precision if compliancebin == 1 & cedaw == 1, row

*UPR - Inaction (Low, Medium, High Precision)
**Percentage of recommendations resulting in inaction from UPR
tab inactionbinminuspartial Precision if inactionbinminuspartial == 1 & upr == 1, row

*UPR - Compliance (Low, Medium, High Precision)
**Percentage of recommendations resulting in compliance from UPR
tab compliancebin Precision if compliancebin == 1 & upr == 1, row

*ECtHR - Inaction (Low, Medium, High Precision)
**Percentage of recommendations resulting in inaction from ECtHR
tab inactionbinminuspartial Precision if inactionbinminuspartial == 1 & ecthr == 1, row

*ECtHR - Compliance (Low, Medium, High Precision)
**Percentage of recommendations resulting in compliance from ECtHR
tab compliancebin Precision if compliancebin == 1 & ecthr == 1, row


***************************************************
*Figure 1 - Hypotheses 1 and 2 (Main Manuscript)
***************************************************
xi: gllamm Precision women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8) 
				parmest, saving("modelprecision.dta", replace)	
				
				use "modelprecision.dta",clear
				sencode parm, gen(parmid)
				label define id 1 "Bureaucratic Capacity" 2 "Political Certainty (squared)" 3 "Political Certainty" 4 "Inst Ind" 5 "Women's Rights" 
				label values parmid id
				keep in 1/5
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-3(1)3) ylabel(1(1)5) ytitle("") rplottype(rspike) title("Precision")xline(0) scheme(s1mono) ysc(outergap(40))
				graph save "g0", replace
				
***********************************************************************
*Substantive Results* (Discussed in-text of main manuscript, "Results" (pg.29))
************************************************************************
xi: gllamm Precision women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8) 
				parmest, saving("modelprecision.dta", replace)	
				
*Predicted Probabilities*
*Probability High Precision when Women's Portfolio Present
gllapred predprobprec3port if women_portfolio_any == 1, mu marginal above(2)
sum predprobprec3port
*0.472

*Probability High Precision when Women's Portfolio Absent
gllapred predprobprec3noport if women_portfolio_any == 0, mu marginal above(2)
sum predprobprec3noport
*0.564

*Probability High Precision when Women's Affairs Portfolio Present, Cabinet Retention Rate Low
gllapred predprobprec3low if women_portfolio_any == 1 & retention_rate_totalsq <= 0.25, mu marginal above(2)
sum predprobprec3low
*0.463

*Probability High Precision when Women's Affairs Portfolio Present, Cabinet Retention Rate Medium
gllapred predprobprec3med if women_portfolio_any == 1 & retention_rate_totalsq > 0.25 & retention_rate_totalsq < .75, mu marginal above(2)
sum predprobprec3med
*0.545

*Probability High Precision when Women's Affairs Portfolio Present, Cabinet Retention Rate High
gllapred predprobprec3high if women_portfolio_any == 1 & retention_rate_totalsq >= 0.75, mu marginal above(2)
sum predprobprec3high
*0.447
				
***********************************************				
*Figure 2 - Hypothesis 3 (Main Manuscript)
***********************************************
xi: gllamm recode_state_inactionbin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelinaction.dta", replace)
				
				use "modelinaction.dta",clear
				sencode parm, gen(parmid)
				label define id 1 "Precision" 2 "CSO Women's Participation" 3 "Exec Const" 4 "NHRI" 5 "Women's Rights" 6 "Female Population" 7 "GDP (log)" 8 "UN Support" 9 "Inst Ind" 10 "Justice Rec" 11 "Legal Rec" 12 "Constant"
				label values parmid id
				keep in 1/12
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-4(2)6) ylabel(1(1)12) ytitle("") rplottype(rspike) title("Inaction")xline(0) scheme(s1mono) aspectratio(1.5)
				graph save "g1", replace
				
*******************************************************************************
*Substantive Results* (Discussed in-text of main manuscript, "Results" (pg.33))
*******************************************************************************

xi: gllamm recode_state_inactionbin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelinaction.dta", replace)

*Predicted Probabilities
**Probability of Inaction when Low Precision
gllapred predprobinactionprec1 if Precision == 1, mu marginal 
sum predprobinactionprec1
*0.466

**Probabiilty of Inaction when High Precision
gllapred predprobinactionprec3 if Precision == 3, mu marginal 
sum predprobinactionprec3
*0.372

***********************************************************************

*******************************************				
*Figure 3 - Hypothesis 3 (Main Manuscript)
*******************************************
/*
*Create Implementation variable, including consideration, delegation, and/or execution from WRCD
gen recode_state_delconsexec2 = .
replace recode_state_delconsexec2 = recode_state_delegation + recode_state_consideration + recode_state_execution
gen recode_state_delconsexec2bin = .
replace recode_state_delconsexec2bin = 1 if recode_state_delconsexec2 == 6
replace recode_state_delconsexec2bin = 1 if recode_state_delconsexec2 == 5
replace recode_state_delconsexec2bin = 1 if recode_state_delconsexec2 == 4
replace recode_state_delconsexec2bin = 1 if recode_state_delconsexec2 == 3
replace recode_state_delconsexec2bin = 1 if recode_state_delconsexec2 == 2
replace recode_state_delconsexec2bin = 1 if recode_state_delconsexec2 == 1
replace recode_state_delconsexec2bin = 0 if recode_state_delconsexec2 == 0
*/

xi: gllamm recode_state_delconsexec2bin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliancebin == 0, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelimplementation.dta", replace)
				
				use "modelimplementation.dta",clear
				sencode parm, gen(parmid)
				label define id 1 "Precision" 2 "CSO Women's Participation" 3 "Exec Const" 4 "NHRI" 5 "Women's Rights" 6 "Female Population" 7 "GDP (log)" 8 "UN Support" 9 "Inst Ind" 10 "Justice Rec" 11 "Legal Rec" 12 "Constant"
				label values parmid id
				keep in 1/12
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-8(2)6) ylabel(1(1)12) ytitle("") rplottype(rspike) title("Implementation")xline(0) scheme(s1mono) aspectratio(1)
				graph save "g2", replace


*******************************************************************************
*Substantive Results* (Discussed in-text of main manuscript, "Results" (pg.33))
*******************************************************************************
xi: gllamm recode_state_delconsexec2bin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliance == 0, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelimplementation.dta", replace)
				
*Predicted Probabilities
**Probability of Implementation when Low Precision
gllapred predprobimpprec1 if Precision == 1, mu marginal 
sum predprobimpprec1
*0.239

**Probability of Implementation when High Precision
gllapred predprobimpprec3 if Precision == 3, mu marginal 
sum predprobimpprec3
*0.421

***********************************************************************
	
**********************************************
*Figure 4 - Hypothesis 4 (Main Manuscript)
**********************************************
xi: gllamm recode_state_compliancebin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelcompliance.dta", replace)
				
				use "modelcompliance.dta",clear
				sencode parm, gen(parmid)
				label define id 1 "Precision" 2 "CSO Women's Participation" 3 "Exec Const" 4 "NHRI" 5 "Women's Rights" 6 "Female Population" 7 "GDP (log)" 8 "UN Support" 9 "Inst Ind" 10 "Justice Rec" 11 "Legal Rec" 12 "Constant"				
				label values parmid id
				keep in 1/12
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-4(2)6) ylabel(1(1)12) ytitle("") rplottype(rspike) title("Compliance")xline(0) scheme(s1mono) aspectratio(1)
				graph save "g3", replace
				
				
*******************************************************************************
*Substantive Results* (Discussed in-text of main manuscript, "Results" (pg.34))
*******************************************************************************
xi: gllamm recode_state_compliancebin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelcompliance.dta", replace)

*Predicted Probabilities
**Probability of Compliance when Precision is Low
gllapred predprobcompprec1 if Precision == 1, mu marginal 
sum predprobcompprec1
*0.797

**Probability of Compliance when Precision is High
gllapred predprobcompprec3 if Precision == 3, mu marginal 
sum predprobcompprec3
*0.444

***********************************************************************



				
				
*********************************************************************************************************************************************SUPPLEMENTARY APPENDIX*************************************************
**********************************************************************************************************
*******************************************
*Table 1A - Descriptive Stats (Appendix)
*******************************************
*Precision
sum Precision, detail
*Political certainty (cabinet retention rate)
sum retention_rate_total, detail
*Bureaucratic Capacity (Women's Affairs Portfolio)
sum women_portfolio_any, detail
*Institutional Independence
sum instind, detail
*Women's Rights (Women's Civil Liberties Index)
sum v2x_gencl, detail
*Women's Civil Society Participation
sum v2csgender, detail
*Executive Constraints
sum xconst, detail
*NHRI
sum nhri, detail
*Female Population (millions)
sum femalepoptotal_mil, detail
*GDP per capita (logged)
sum loggdpcap, detail
*Government Costs of Noncompliance (UN Support)
sum meaness_wvsadjusted, detail
*Provision of Justice/Accountability Recommendation
sum action_3, detail
*Legal/Legislative Change Recommendation
sum action_5, detail
*Inaction (binary)
sum recode_state_inactionbin, detail
*Implementation (binary)
sum recode_state_delconsexec2bin, detail
*Compliance (binary)
sum recode_state_compliancebin, detail
***********************************************

*******************************************
*Table 2A - Hypotheses 1 and 2 (Appendix)
*******************************************

xi: gllamm Precision women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8) 
				parmest, saving("modelprecision.dta", replace)	

/*
number of level 1 units = 3735
number of level 2 units = 192
number of level 3 units = 43
 
Condition Number = 51.955481
 
gllamm model 
 
log likelihood = -3585.5639
 
Robust standard errors
----------------------------------------------------------------------------------------
             Precision |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------+----------------------------------------------------------------
Precision              |
   women_portfolio_any |   -.424273   .1566562    -2.71   0.007    -.7313135   -.1172326
retention_rate_totalsq |  -1.321446   .7193608    -1.84   0.066    -2.731367    .0884754
  retention_rate_total |   1.330235   .8801584     1.51   0.131    -.3948442    3.055313
               instind |   .7037866   .0753508     9.34   0.000     .5561017    .8514714
             v2x_gencl |   .3849671   .4469898     0.86   0.389    -.4911168    1.261051
-----------------------+----------------------------------------------------------------
_cut11                 |
                 _cons |  -.4725401   .4511467    -1.05   0.295    -1.356771    .4116912
-----------------------+----------------------------------------------------------------
_cut12                 |
                 _cons |   .6873043   .4515015     1.52   0.128    -.1976224    1.572231
----------------------------------------------------------------------------------------

 
 
Variances and covariances of random effects
------------------------------------------------------------------------------

 
***level 2 (meeting_reportid)
 
    var(1): .09985837 (.02658213)
 
***level 3 (ccode)
 
    var(1): 2.517e-11 (3.098e-10)
------------------------------------------------------------------------------


*/

*************************************************
*Table 3A, Column 1 - Hypothesis 3 (Appendix)
*************************************************

xi: gllamm recode_state_inactionbin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelinaction.dta", replace)

/*
number of level 1 units = 1770
number of level 2 units = 150
number of level 3 units = 37
 
Condition Number = 641.9629
 
gllamm model 
 
log likelihood = -1158.1407
 
Robust standard errors
------------------------------------------------------------------------------------------
recode_state_inactionbin |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------------+----------------------------------------------------------------
               Precision |  -.1848363   .0987115    -1.87   0.061    -.3783072    .0086347
              v2csgender |   .2378064   .3437211     0.69   0.489    -.4358745    .9114873
                  xconst |  -.1362671   .1155476    -1.18   0.238    -.3627362    .0902021
                    nhri |  -.0531192   .1893653    -0.28   0.779    -.4242684    .3180299
               v2x_gencl |   .7139867   2.495131     0.29   0.775     -4.17638    5.604354
      femalepoptotal_mil |  -.0007608   .0037143    -0.20   0.838    -.0080407    .0065191
               loggdpcap |     .01566   .1002062     0.16   0.876    -.1807405    .2120604
     meaness_wvsadjusted |  -.0489374   .0375104    -1.30   0.192    -.1224565    .0245817
                 instind |  -.1350499   .2052826    -0.66   0.511    -.5373964    .2672966
                action_3 |  -.3172273   .2033678    -1.56   0.119    -.7158208    .0813662
                action_5 |   .0065284   .1589344     0.04   0.967    -.3049772    .3180341
                   _cons |   .1303285   .9282965     0.14   0.888    -1.689099    1.949756
------------------------------------------------------------------------------------------
 
 
Variances and covariances of random effects
------------------------------------------------------------------------------

 
***level 2 (meeting_reportid)
 
    var(1): .29211574 (.1482429)
 
***level 3 (ccode)
 
    var(1): 3.045e-16 (4.178e-13)
------------------------------------------------------------------------------
*/

*************************************************
*Table 3A, Column 2 - Hypothesis 3 (Appendix)
*************************************************

xi: gllamm recode_state_delconsexec2bin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliancebin == 0, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelimplementation.dta", replace)

/*

number of level 1 units = 943
number of level 2 units = 129
number of level 3 units = 37
 
Condition Number = 636.95003
 
gllamm model 
 
log likelihood = -580.20668
 
Robust standard errors
----------------------------------------------------------------------------------------------
recode_state_delconsexec2bin |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------------+----------------------------------------------------------------
                   Precision |   .4032317   .1256546     3.21   0.001     .1569532    .6495101
                  v2csgender |    .433135   .3927249     1.10   0.270    -.3365916    1.202862
                      xconst |   .0933623   .1303675     0.72   0.474    -.1621533    .3488779
                        nhri |  -.1798518   .2504203    -0.72   0.473    -.6706666     .310963
                   v2x_gencl |   -3.05392   2.747054    -1.11   0.266    -8.438047    2.330206
          femalepoptotal_mil |  -.0064291   .0058163    -1.11   0.269    -.0178289    .0049708
                   loggdpcap |  -.0428646   .1076394    -0.40   0.690     -.253834    .1681048
         meaness_wvsadjusted |   .0849248   .0604738     1.40   0.160    -.0336017    .2034513
                     instind |  -.6640227   .1940198    -3.42   0.001    -1.044294   -.2837509
                    action_3 |   .6980407   .2021121     3.45   0.001     .3019083    1.094173
                    action_5 |   -.261208   .2570829    -1.02   0.310    -.7650812    .2426653
                       _cons |    .372432    1.27249     0.29   0.770    -2.121603    2.866467
----------------------------------------------------------------------------------------------
 
 
Variances and covariances of random effects
------------------------------------------------------------------------------

 
***level 2 (meeting_reportid)
 
    var(1): .47106535 (.13126164)
 
***level 3 (ccode)
 
    var(1): 3.502e-11 (1.955e-10)
------------------------------------------------------------------------------
*/

***********************************************
*Table 3A, Column 3 - Hypothesis 4 (Appendix)
***********************************************

xi: gllamm recode_state_compliancebin Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				parmest, saving("modelcompliance.dta", replace)

/*

number of level 1 units = 2037
number of level 2 units = 152
number of level 3 units = 37
 
Condition Number = 642.75343
 
gllamm model 
 
log likelihood = -1240.4081
 
Robust standard errors
--------------------------------------------------------------------------------------------
recode_state_compliancebin |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
                 Precision |  -.8802428   .0737051   -11.94   0.000    -1.024702   -.7357835
                v2csgender |  -.1305505   .3691546    -0.35   0.724    -.8540802    .5929791
                    xconst |   .0887646   .1372238     0.65   0.518    -.1801891    .3577182
                      nhri |   .1047922   .2588232     0.40   0.686     -.402492    .6120764
                 v2x_gencl |   .7648204    2.44898     0.31   0.755    -4.035092    5.564732
        femalepoptotal_mil |  -.0050645   .0066142    -0.77   0.444    -.0180281    .0078991
                 loggdpcap |  -.0699801   .1440325    -0.49   0.627    -.3522786    .2123184
       meaness_wvsadjusted |  -.0021456   .0628076    -0.03   0.973    -.1252462    .1209551
                   instind |  -.0880789   .2683618    -0.33   0.743    -.6140584    .4379006
                  action_3 |  -.4262854   .1856264    -2.30   0.022    -.7901065   -.0624644
                  action_5 |    .091176   .2061243     0.44   0.658    -.3128201    .4951721
                     _cons |   2.126272   1.562712     1.36   0.174    -.9365877    5.189131
--------------------------------------------------------------------------------------------
 
 
Variances and covariances of random effects
------------------------------------------------------------------------------

 
***level 2 (meeting_reportid)
 
    var(1): .56132552 (.18000931)
 
***level 3 (ccode)
 
    var(1): .12374311 (.1144447)
------------------------------------------------------------------------------

*/

***************************************

*********************************************
*Table 4A (Appendix)
*********************************************
*SOLS Change as Alternative Measure of Political Certainty (Column 1)
xi: gllamm Precision solschange women_portfolio_any instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8)
						
*Executive Ideology as Alternative Measure of Political Certainty (Column 2)
xi: gllamm Precision execrlc women_portfolio_any instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8)

*Executive Ideology*Years in Office (Column 3)
xi: gllamm Precision execleftyrsoffice execleft yrsoffc women_portfolio_any instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8)

*Opposition Vote Share (Column 4)
xi: gllamm Precision opp1vote women_portfolio_any instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8)

****************************************************
*Table 5A (Appendix)
****************************************************
*Inaction (Column 1)
*Model Predicting Inaction (accounting for direct effect of uncertainty)
xi: gllamm recode_state_inactionbin Precision retention_rate_totalsq retention_rate_total women_portfolio_any v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)

*Implementation (Column 2)
*Model Predicting Implementation (accounting for direct effect of uncertainty)
xi: gllamm recode_state_delconsexec2bin Precision retention_rate_totalsq retention_rate_total women_portfolio_any v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliance == 0, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)

*Complinace (Column 3)
*Model Predicting Compliance (accounting for direct effect of uncertainty)
xi: gllamm recode_state_compliancebin Precision retention_rate_totalsq retention_rate_total women_portfolio_any v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)


****************************************************
*Table 6A (Appendix)
****************************************************
*Inaction (Column 1) 
/*
gen inactionbinminuspartial = .
replace inactionbinminuspartial = 1 if recode_state_inaction == 2
replace inactionbinminuspartial = 0 if recode_state_inaction == 0
*/

xi: gllamm inactionbinminuspartial Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)

*Implementation	(Column 2)
/*
gen delegationbinsanspartial = .
replace delegationbinsanspartial = 1 if recode_state_delegation == 2
replace delegationbinsanspartial = 0 if recode_state_delegation == 0

gen considerationbinsanspartial = .
replace considerationbinsanspartial = 1 if recode_state_consideration == 2
replace considerationbinsanspartial = 0 if recode_state_consideration == 0

gen executionbinsanspartial = .
replace executionbinsanspartial = 1 if recode_state_execution == 2
replace executionbinsanspartial = 0 if recode_state_execution == 0

gen delconsexec2sanspartialA = delegationbinsanspartial + considerationbinsanspartial + executionbinsanspartial

gen delconsexec2binsanspartialA = .
replace delconsexec2binsanspartialA = 1 if delconsexec2sanspartialA == 3
replace delconsexec2binsanspartialA = 1 if delconsexec2sanspartialA == 2
replace delconsexec2binsanspartialA = 1 if delconsexec2sanspartialA == 1
replace delconsexec2binsanspartialA = 0 if delconsexec2sanspartialA == 0
*/

xi: gllamm delconsexec2binsanspartialA Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliancebin == 0, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)
				

*Compliance (Column 3)
/*
gen compliancebinminuspartial = .
replace compliancebinminuspartial = 1 if recode_state_compliance == 2
replace compliancebinminuspartial = 0 if recode_state_compliance == 0
*/

xi: gllamm compliancebinminuspartial Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(logit) i(meeting_reportid ccode) nip(8)

****************************************************
*Table 7A (Appendix)
****************************************************
*Inaction (Column 1)
/*
gen recode_state_inactionord = .
replace recode_state_inactionord = 2 if State_Inaction == 1
replace recode_state_inactionord = 1 if State_Inaction == 333
replace recode_state_inactionord = 0 if State_Inaction == 0
*/
xi: gllamm recode_state_inactionord Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8)

*Implementation (Column 2)

*recode_state_delconsexec2 ranges from no consideration, delegation, or execution to full consideration, delegation, and exeuction, the middle categories are all different levels of partial consideration, delegation, or execution

xi: gllamm recode_state_delconsexec2 Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliancebin == 0, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8)

*Compliance (Column 3)
/*
gen recode_state_compliance = .
replace recode_state_complianceord = 2 if State_Compliance == 1
replace recode_state_complianceord = 1 if State_Compliance == 333
replace recode_state_complianceord = 0 if State_Compliance == 0
*/

xi: gllamm recode_state_complianceord Precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8)


*******************************************************************************
****************************************************
*Table 8A (Appendix)
****************************************************
*Inaction - Column 1
gsem (precision <- women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, oprobit) (recode_state_inactionbin <- precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, probit), vce(cluster ccode)

*Implementation (Column 2)
gsem (precision <- women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, oprobit) (recode_state_delconsexec2bin <- precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliancebin != 1, probit vce(cluster ccode))

*Compliance (Column 3)
gsem (precision <- women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, oprobit) (recode_state_compliancebin <- precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, probit vce(cluster ccode))

***********************************************************
**Table 9A (Appendix)
************************************************************
*Inaction (Column 1)
gsem (precision <- women_portfolio_any retention_rate_totalsq retention_rate_total  instind v2x_gencl, oprobit) (recode_state_inactionbin <- precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, probit), vce(cluster meeting_reportid)

*Implementation (Column 2)
gsem (precision <- women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, oprobit) (recode_state_delconsexec2bin <- precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5 if recode_state_compliancebin != 1, probit vce(cluster meeting_reportid))

*Compliance (Column 3)
gsem (precision <- women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, oprobit) (recode_state_compliancebin <- precision v2csgender xconst nhri v2x_gencl femalepoptotal_mil loggdpcap meaness_wvsadjusted instind action_3 action_5, probit vce(cluster meeting_reportid))

***********************************************************
**Figure 1A (Appendix)
************************************************************
twoway qfit Precision retention_rate_total if women_portfolio_any == 1

***********************************************************
**Table 10A (Appendix)
************************************************************

xi: gllamm Precision women_portfolio_any retention_rate_totalsq retention_rate_total instind v2x_gencl, robust family(binomial) link(ologit) i(meeting_reportid ccode) nip(8) 	


*Generating Predicted Probabilities - Most Precise Recommendations
** Women's Porfolio Present, Low Cabinet Retention
gllapred predprobprec3_0a if women_portfolio_any == 1 & retention_rate_totalsq > 0 & retention_rate_totalsq < .2, mu marginal above(2)
sum predprobprec3_0a
*0.463

**Women's Portfolio Present, Low/Med Cabinet Retention
gllapred predprobprec3_1a if women_portfolio_any == 1 & retention_rate_totalsq > .2 & retention_rate_totalsq <= .6, mu marginal above(2)
sum predprobprec3_1a
*0.566

**Women's Portfolio Present, Med/High Cabinet Retention
gllapred predprobprec3_2a if women_portfolio_any == 1 & retention_rate_totalsq > .6 & retention_rate_totalsq <= .8, mu marginal above(2)
sum predprobprec3_2a
*0.505

**Women's Portfolio Present, High Cabinet Retention
gllapred predprobprec3_3a if women_portfolio_any == 1 & retention_rate_totalsq > .8 & retention_rate_totalsq <= 1, mu marginal above(2)
sum predprobprec3_3a
*0.437



*Plotting probabilities - Med/High Precision Recommendations
**Women's Portfolio Present, Low Cabinet Retention Rate
gllapred predprobprec0_0a if women_portfolio_any == 1 & retention_rate_totalsq > 0 & retention_rate_totalsq < .2, mu marginal above(1)
sum predprobprec0_0a
*0.719

**Women's Portfolio Present, Low/Med Cabinet Retention Rate
gllapred predprobprec0_1a if women_portfolio_any == 1 & retention_rate_totalsq > .2 & retention_rate_totalsq <= .6, mu marginal above(1)
sum predprobprec0_1a
*0.802

**Women's Portfolio Present, Med/High Cabinet Retention Rate
gllapred predprobprec0_2a if women_portfolio_any == 1 & retention_rate_totalsq > .6 & retention_rate_totalsq <= .8, mu marginal above(1)
sum predprobprec0_2a
*0.758

**Women's Portfolio Present, High Cabinet Retention Rate
gllapred predprobprec0_3a if women_portfolio_any == 1 & retention_rate_totalsq > .8 & retention_rate_totalsq <= 1, mu marginal above(1)
sum predprobprec0_3a
*0.700
